/**
 * 组件库入口
 * */

import WhText from './word/text'
import WhImage from './image'
import ImageCarousel from './image-carousel'
import RectangleBorder from './rectangle-border'
import Iframe from './iframe'
import Button from './button'
import bgMusic from './bg-music'
import ElTime from './el-time'
import HorizontalBarChart from './horizontal-barChart'
import BaseBarChart from './base-barChart'
import ArcBarChart from './arc-barChart'
import ContrastBarChart from './contrast-barChart'
import LineSimpleBase from './lineSimple-base'
import LineSimpleAreaStack from './lineSimple-areaStack'
import LineSimpleColumnar from './lineSimple-columnar'
import LineSimpleContrast from './lineSimple-contrast'





import BasePieChart from './pieChart/base-pieChart'
import DimensionPieChart from './pieChart/dimension-pieChart'
import CirclePieChart from './pieChart/circle-pieChart'
import GaugePieChart from './pieChart/gauge-pieChart'
import BaseRadarChart from './radarChart/base-radarChart'
import Whvideo from './video'
import DigitalFlop from './word/digital-flop'
import ScrollBoard from './word/scroll-board'
import NowTime from './word/now-time'
import BaseMap from './map/base-map'
import BaseMap1 from './map1'
import TabList from './word/list'

// 所有组件列表
const components = [
	WhText,
	WhImage,
	Whvideo,
	ImageCarousel,
	RectangleBorder,
	Iframe,
	Button,
	bgMusic,
	ElTime,
	BasePieChart,
	BaseBarChart,
	HorizontalBarChart,
	ArcBarChart,
	ContrastBarChart,
	LineSimpleBase,
	LineSimpleAreaStack,
	LineSimpleContrast,
	LineSimpleColumnar,
	DimensionPieChart,
	CirclePieChart,
	GaugePieChart,
	BaseRadarChart,
	DigitalFlop,
	ScrollBoard,
	NowTime,
	BaseMap,
	BaseMap1,
	TabList
]
// 定义 install 方法，接收 Vue 作为参数
const install = function (Vue) {
	// 判断是否安装，安装过就不继续往下执行
	if (install.installed) returnd
	install.installed = true
	// 遍历注册所有组件
	components.map(component => Vue.component(component.name, component))
}

// 检测到 Vue 才执行，毕竟我们是基于 Vue 的
if (typeof window !== 'undefined' && window.Vue) {
	install(window.Vue)
}

let _qk_register_components_object = {};
components.forEach(item => {
	_qk_register_components_object[item.name] = item
})


export {
	NowTime,
	DigitalFlop,
	GaugePieChart,
	CirclePieChart,
	DimensionPieChart,
	BaseRadarChart,
	ElTime,
	BasePieChart,
	WhText,
	WhImage,
	ImageCarousel,
	RectangleBorder,
	Iframe,
	Button,
	bgMusic,
	BaseBarChart,
	HorizontalBarChart,
	ArcBarChart,
	ContrastBarChart,
	LineSimpleBase,
	LineSimpleAreaStack,
	LineSimpleColumnar,
	Whvideo,
	ScrollBoard,
	BaseMap,
	BaseMap1,
	TabList,
	_qk_register_components_object
}



export default {
	install,
	// 所有组件，必须具有 install，才能使用 Vue.use()
}
